<?php
/**
 * Created by PhpStorm.
 * User: yuyiwen
 * Date: 2018/11/30
 * Time: 上午10:13
 */
use Slince\SmartQQ\Client;
use Slince\SmartQQ\Message\Request\GroupMessage;
use Slince\SmartQQ\Message\Content;
use Slince\SmartQQ\Credential;
include __DIR__.'/bootstrap.php';
include 'config.php';
try {
    $db = new PDO($dsn, $username, $password); // also allows an extra parameter of configuration
} catch(PDOException $e) {
    die('Could not connect to the database:<br/>' . $e);
}

$time = time();
$result = $db->prepare('SELECT * FROM `sm_member`');
$result->execute();
$info = $result->fetch(PDO::FETCH_ASSOC);
$s = Credential::fromArray(json_decode($info['array'], true));
$smartQQ = new Client($s);
$groups = $smartQQ->getGroups();
echo '<pre>';
print_r($groups);